package vashion.azeroth.core.personal.tran.pojo;

import java.math.BigDecimal;
import java.util.Date;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;

import vashion.azeroth.common.date.DateUtil;
import vashion.azeroth.common.math.BigDecimalUtil;
import vashion.azeroth.core.pojo.BaseObject;

public class PersonalVAccount extends BaseObject {

	private static final long serialVersionUID = -4002919766851096684L;
	
	@JsonIgnore
	private Long vAccountId;

    private Long memberId;

    private String memberName;

    private long totalBalance;
                       
    private long useableBalance;
    
    private long freezeBalance;

    @JsonIgnore
    private Date timeAdd;
    
    @JsonIgnore
    private Date timeEdit;
    
    @JsonIgnore
    private String remark;
    
    public String getTotalBalanceShow() {
    	return BigDecimalUtil.divide(new BigDecimal(totalBalance), new BigDecimal(100)).toString();
    }
    
    public String getUseableBalanceShow() {
    	return BigDecimalUtil.divide(new BigDecimal(useableBalance), new BigDecimal(100)).toString();
    }
    
    public String getFreezeBalanceShow() {
    	return BigDecimalUtil.divide(new BigDecimal(freezeBalance), new BigDecimal(100)).toString();
    }
    
	public String getTimeAddStr() {
		try {
			return DateUtil.dateFormat(DateUtil.ymdhms_DATE_FORMAT, DateUtil.ymdhmsFormat(timeAdd));
		} catch (ParseException e) {
			e.printStackTrace();
		} catch (java.text.ParseException e) {
			e.printStackTrace();
		}
		return "";
	}
	
	public String getTimeEditStr() {
		try {
			return DateUtil.dateFormat(DateUtil.ymdhms_DATE_FORMAT, DateUtil.ymdhmsFormat(timeEdit));
		} catch (ParseException e) {
			e.printStackTrace();
		} catch (java.text.ParseException e) {
			e.printStackTrace();
		}
		return "";
	}

    public Long getvAccountId() {
		return vAccountId;
	}

	public void setvAccountId(Long vAccountId) {
		this.vAccountId = vAccountId;
	}

	public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }
    
	public long getTotalBalance() {
		return totalBalance;
	}

	public void setTotalBalance(long totalBalance) {
		this.totalBalance = totalBalance;
	}

	public long getUseableBalance() {
		return useableBalance;
	}

	public void setUseableBalance(long useableBalance) {
		this.useableBalance = useableBalance;
	}

	public long getFreezeBalance() {
		return freezeBalance;
	}

	public void setFreezeBalance(long freezeBalance) {
		this.freezeBalance = freezeBalance;
	}

	public Date getTimeAdd() {
        return timeAdd;
    }

    public void setTimeAdd(Date timeAdd) {
        this.timeAdd = timeAdd;
    }

    public Date getTimeEdit() {
        return timeEdit;
    }

    public void setTimeEdit(Date timeEdit) {
        this.timeEdit = timeEdit;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}